package com.scmt.hmzd.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.scmt.hmzd.entity.HmCoupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 优惠券 Mapper 接口
 * </p>
 *
 * @author ycy
 * @since 2023-03-10
 */
public interface HmCouponMapper extends BaseMapper<HmCoupon> {

    Integer countUseNum(Long couponId);

    Integer countTakeNum(Long couponId);


    Map<String, Long> getCouponCountByStatus(String userId);

    IPage<HmCoupon> getCouponListByStatus(@Param("page") Page pageData, @Param("userId") String userId, @Param("status") Integer status);

    IPage<HmCoupon> getCouponList(@Param("page") Page pageData, @Param("userId") String userId);
}
